/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.ban.nmpp.handler;

/**
 *
 * @author alexmu
 */
public class SE2DWWorkerFactory {

    public static SE2DWWorker getSE2DBWroker(TableSe2DWHandler pTableSe2DBHandler, int i) throws Exception {
        SE2DWWorker se2DWWorker = null;
        String dwType = pTableSe2DBHandler.getTableSe2DBRule().getDbType();
        if (dwType.equals("wxupdate")) {
            se2DWWorker = new SE2DWWorkerMPPUpdateWX(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("mppcommon")) {
            se2DWWorker = new SE2DWWorkerMpp(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("mppc")) {
            se2DWWorker = new SE2DWWorkerMppC(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("mppui")) {
            se2DWWorker = new SE2DWWorkerMppUI(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("xwupdate")) {
            se2DWWorker = new SE2DWWorkerMPPUpdateXW(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("xwupdateE")) {
            se2DWWorker = new SE2DWWorkerMPPUpdateXWE(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("temnnmpp")) {
            se2DWWorker = new SE2DWWorkerMppTemU(pTableSe2DBHandler, dwType);
        } else if (dwType.equals("mppuser")) {
            se2DWWorker = new SE2DWWorkerMppUser(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("mppuserE")) {
            se2DWWorker = new SE2DWWorkerMppUserE(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("nrdUpdate")) {
            se2DWWorker = new SE2DWWorkernrdUpdate(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("nfansUpdate")) {
            se2DWWorker = new SE2DWWorkernfansUpdate(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("allUpdate")) {
            se2DWWorker = new SE2DWWorkerallUpdate(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("allUpdateE")) {
            se2DWWorker = new SE2DWWorkerallUpdateE(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("nfansUpdateE")) {
            se2DWWorker = new SE2DWWorkernfansUpdateE(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("nrdUpdateE")) {
            se2DWWorker = new SE2DWWorkernrdUpdateE(pTableSe2DBHandler, dwType);
        }else if (dwType.equals("pickv")) {
            se2DWWorker = new SE2DWWorkerpictureKV(pTableSe2DBHandler, dwType);
        } else {
            throw new Exception("unknown dw type " + dwType);
        }
        se2DWWorker.init();
        return se2DWWorker;
    }
}
